{%extends 'main.html'%}

{%block script%}
	{%if not channel%}
		window.confirm('Please select a channel')
		window.location = '/'
	{%endif%}
	
	$('command.edit').toggle(function(){
		$('form.edit').show()
		$('#details').hide()
	}, function(){
		$('form.edit').hide()
		$('#details').show()
	})
	
	$('command.delete').click(function(){
		if(confirm('Are you sure?')){
      // not yet
    }
    return false;
	})
{%endblock%}

{%block style%}
	form.edit{display:none}
{%endblock%}

{%block content%}
	
	
	<h2>Details</h2>
	
	<menu type="toolbar">
		<command class="edit">edit</command>
		<command class="delete">delete</command>
	</menu>
	
	<dl id="details">
		<dt>name</dt>
			<dd>{{channel.name}}</dd>
		<dt>created</dt>
			<dd>{{channel.created}}</dd>
	</dl>
	
	<form method="put" action="/channels/{{channel.key}}" class="edit">
		<input name="name"{%if channel%} value="{{channel.name}}"{%endif%}>
		<input type="submit">
	</form>
	
	<h3>Feeds</h3>
{%endblock%}